<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<html>
    <head>
        <link rel="stylesheet" type="text/css" href="../css/popup.css"/>
        <link rel="stylesheet" type="text/css" href="../css/kapiform.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/kapi.js"></script>
        <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.rateit.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/easypaginate.js"></script>

        <script type="text/javascript" language="javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            $j(document).ready(function(){
                
                $j('.keysearch12').live('keyup',function(){
                    if($j('.keysearch12').val() == ""){
                        $j('.rich-table-row').show();
                                   
                    }else{
                        $j('.rich-table-row').hide();
                        $j('.rich-table-row').each(function(){
                            html = $j(this).html();
                            if(   ununicode(html).indexOf(  ununicode($j('.keysearch12').val()) ) > -1    )  {
                                $j(this).show();
                            }else{
                                $j(this).hide();
                            }
                        });
                    }

                });
                    
                $j('.contactN950').live('click',function(){
                    object = $j(this).next();
                    var pn100KH = $j('#formKHCN\\:pn100').val();
                    $j(".mesage").text("");
                    $j.post("contactCRM.jsp?action=editajaxpage&pn100="+ pn100KH+"&table=N100", function(data){
                        $j('.customer-boxcontact').html(data);
                    });
                    
                });
                $j('.acountT025').live('click',function(){
                    $j(".mesage").text("");
                    object = $j(this).next();
                    var pn100KH = $j('#formKHCN\\:pn100').val();         
                    $j.post("accountCRM.jsp?action=editajaxpage&pn100="+pn100KH+"&tv026=N100",function(data){
                        $j('.customer-boxacount').html(data);
                    }) ;
                    
                });
                
                $j('.customerK100').live('click',function(){
                    $j(".mesage").text("");
                    object = $j(this).next();
                    var pn100KH = $j('#formKHCN\\:pn100').val();  
                    $j.post("customerdemo.jsp?action=editEmp&pn100="+ pn100KH+"&table=formload&pt025=1&itemid=N100", function(data){
                        $j('.customer-boxcustomer').html(data);
                    });
                    
                });
                
                $j('.infoN350').live('click',function(){
                    $j(".mesage").text("");
                    object = $j(this).next();
                    var pn100KH = $j('#formKHCN\\:pn100').val(); 
                    $j.post("passportCRM.jsp?action=editajaxpage&pn100="+ pn100KH, function(data){
                        $j('.customer-boxN350').html(data);
                    });
                    
                });
                $j('.companyCRM').live('click',function(){
                    object = $j(this).next();
                    var pn100KH = $j('#formKHCN\\:pn100').val();   
                    $j.post("companyCRM.jsp?action=editajaxpage&pn100="+ pn100KH, function(data){
                        $j('.customer-companyCRM').html(data);
                    }) ;
                    
                }); 
              
                $j('.addTour1').live('click',function(){
                    //  alert($j(this).parent().attr('class'));
                    // alert($j(this).parent().parent().parent().attr('class'));
                    $j(this).parent().parent().parent().css("display","none");
                    
                    $j(".popup-content").css("display","block");
                    
                });
                $j('.returnFind').live("click",function(){
                    $j(this).parent().parent().parent().css("display","none");
                    $j(".formfrist").css("display","block");
                });
                
                // chon nguoi vao cong ty 
                $j(".checkTour").live("change",function(){  
                    
                    if($j(this).is(':checked')){ 
                        pn100 = $j(this).attr("lang");  
                        pk100 = $j('#fromSearchDD\\:FK100DD').val();
                        //    alert(pk100);
                        showPleaseWait();
                        $j.post("actioncheckTour.jsp?action=checkTourDD&pn100="+pn100+"&fk100="+pk100,function(data){
                            if(data!= null){
                                $j(".mesage123").text("Cập nhật thành công !");
                                hidePleaseWait();
                            }
                        });
                    
                    }
    
                });
                
                $j('.check_select').live('click',function(){
                    var lang= $j(this).attr("lang");
                    fk100 = $j(this).parent().attr("lang");
                    var boool;
                    //alert(lang)               
                    if( $j(this).is(":checked"))
                    {
                        boool = true;
                    }
                    else
                    {
                        boool = false;
                    }
                            
                    $j.post("listEmployee.jsp?action=addnotcheckAll&fk100CTT="+fk100+"&pn100="+lang+"&boolNV="+boool+"&typecheck=NV",function(data){
                            
                    });
                });
                
                $j(".checkAll").live("click",function(){
                    //alert('check all');
                    flag = $j('.checkAll').is(':checked');
                    fk100 = $j(this).parent().parent().prev().parent().parent().next().children().children().next().children().attr('lang');
                    //    alert(fk100);
                    $j(".check_select").each(function(){
                        $j('.check_select')  .attr('checked', flag);
                    });
                        
                    var boool;
                    if( $j(this).is(":checked"))
                    {
                        boool = true;
                    }
                    else
                    {
                        boool = false;
                    }
                    $j.post("listEmployee.jsp?action=addcheckAll&fk100CTT="+fk100+"&boolNV="+boool+"&typecheck=NV",function(data){
                            
                    });
                    //                    $j.post("workChargeCM.jsp?action=addAllCusp100&boool="+boool+"&kh=CM",function(data){
                    //                            
                    //                    });

                });
                $j( ".sendSMS_person" ).click(function() {
                    $j( "#togglesms" ).show();
                    $j( "#togglesms" ).animate({height:'auto',opacity:'0.9'},"slow");
                    $j( "#togglesms" ).animate({width:'39%',opacity:'0.9'},"slow");
                    var info = $j(this).attr('lang');
                    fk100 = $j(this).parent().attr("lang");
                    $j.post("SgtSMS.jsp?"+info+"&fk100="+fk100,function(data){
                        if(data!=null){
                            $j( "#togglesms" ).html(data);
                        }
                    });
                });
            });
        </script>    
    </head>

    <body>
        <f:view>
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
            <div id="togglesms">

            </div>
            <a4j:form >
                <div class="content_detail">
                    <div class="list_item_user">
                        <div class="item_content" style="display: block">
                            <div class="infomation_form">
                                <div class="card_add">
                                    <h:outputLink style="float:left;" rendered="#{loginSession.right.COM_EMP_CRE}"    value="employeePersonalDD.jsp?action=addEmp&choisetab=1&flagform=3&page=#{CustomerBean.pagereload}&table=A&step=listEm&fn600=3&idk100=#{CustomerBean.fk100}&nn117=1&height=250px&width=400px" styleClass="fancybox">
                                        <img src="../images/add_tab.png" alt="add" title="add" /> <h:outputText value="#{locale.addEmployee}"/>
                                    </h:outputLink>
                                    <div class="fast_search1">

                                        <h:inputText style="width:235px !important;" value="" onfocus="if(this.value=='')this.value='';" styleClass="keysearch12" />
                                        <div  style="margin-left:5px; float:left" class="buttonsearch1">

                                        </div>



                                    </div>

                                    <h:outputLink style="color:#fff;float:right;margin-right:6px;"   value="popUpSendEmail.jsp?page=listEmployee&step=1&fk100reload=#{CustomerBean.fk100}&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new abc" id="thickbox3"  >
                                        <img src="../images/icon_email1.png" alt="Email" title="Gửi email"/>
                                    </h:outputLink>
                                    <div class="classimageSMS" lang="<h:outputText value="#{CustomerBean.fk100}"/>">
                                        <img src="../images/viewSMS.png" class="sendSMS_person" lang="page=sendSMSitemCompany1" title="Xác nhận  SMS"/>
                                    </div>
                                    <%--    <h:outputLink style="color:#fff;float:right;margin-right:6px;"   value="sendMoreSMS.jsp?page=listEmployee&step=1&fk100reload=#{CustomerBean.fk100}&height=453&amp;width=741&amp;modal=true" styleClass="fancybox add_new abc"  >
                                        <img src="../images/icon_sms1.png" alt="SMS" title="Gửi SMS"/>
                                    </h:outputLink> --%>


                                </div>
                                <div style="float:left ; width:100%; min-height:110px;">
                                    <div style="float:left; width:100%; min-height:100px; height:auto;">
                                        <rich:dataTable value="#{CustomerBean.listdifn100C}" var="item"

                                                        rows="500"
                                                        rowClasses="greyRow, whiteRow"

                                                        style=" margin-left:10px;width:98%"
                                                        width="50%" rowKeyVar="index"
                                                        id="table" >

                                            <rich:column style="width:25px;">
                                                <f:facet name="header">
                                                    <h:outputText value="#{locale.num1}" />
                                                </f:facet>
                                                <div style="width:25px; text-align: center">
                                                    <h:outputText value="#{index+1}" />

                                                </div>
                                            </rich:column>

                                            <rich:column style="width:25px;">
                                                <f:facet name="header">
                                                    <h:selectBooleanCheckbox styleClass="checkAll"/>
                                                </f:facet>
                                                <div style="width:25px; text-align: center" lang="<h:outputText value="#{item.fk100}"/> ">
                                                    <h:selectBooleanCheckbox styleClass="check_select" lang="#{item.pn100}"  />  

                                                </div>
                                            </rich:column>

                                            <rich:column style="width:200px"  >
                                                <f:facet name="header">
                                                    <h:outputText value="#{locale.frist_lastname}" />
                                                </f:facet>

                                                <div style="width:200px; text-align: left">
                                                    <a href='customer.jsp?action=linkCus&pnPN100=<h:outputText value="#{item.pn100}"/>&type=<h:outputText value="#{item.ni104}"/>'> <h:outputText value=" #{item.hoten}"  /></a>

                                                </div>
                                            </rich:column >
                                            <rich:column style="width:100px"  >
                                                <f:facet name="header">
                                                    <h:outputText value="Điện thoại" />
                                                </f:facet>

                                                <div style="width:100px; text-align: left" lang="<h:outputText value="#{CustomerBean.fk100}"/>">
                                                    <h:outputText value="#{item.nv121}" styleClass="sendSMS_person" lang="page=sendSMSitemCompany1&group=1&hoten=#{item.hoten}&phone=#{item.nv121}&fn100=#{item.pn100}"/>

                                                    <%--  <h:outputText value="#{item.nv121}"  escape="false"/> --%>
                                                </div>
                                            </rich:column >
                                            <rich:column style="width:150px"  >
                                                <f:facet name="header">
                                                    <h:outputText value="Email" />
                                                </f:facet>

                                                <div style="width:150px; text-align: center">
                                                    <h:outputText value="#{item.nv120}"  escape="false"/>
                                                </div>
                                            </rich:column >
                                            <rich:column   style="width:auto" >
                                                <f:facet name="header">
                                                    <h:outputText value="#{locale.address}" />
                                                </f:facet>

                                                <div style="width:auto; text-align: left">
                                                    <h:outputText value="#{item.nv112}"  escape="false"/>
                                                </div>
                                            </rich:column >
                                            <rich:column   style="width:auto" >
                                                <f:facet name="header">
                                                    <h:outputText value="Cập nhật" />
                                                </f:facet>

                                                <div style="width:auto; text-align: left">

                                                    <h:outputText style="font-size:10px;" value="#{item.nl148}" />


                                                    <h:outputText style="font-size:10px;" value="#{item.nl149}" />
                                                </div>
                                            </rich:column >
                                            <rich:column style="width:35px;">
                                                <f:facet name="header">
                                                    <h:outputText value="Action" />
                                                </f:facet>
                                                <h:outputLink    rendered="#{loginSession.right.COM_EMP_MOD}"    value="customerInputExpand.jsp?action=editEmp&choisetab=1&flagform=3&pn100=#{item.pn100}&page=#{CustomerBean.pagereload}&type=#{item.ni104}&table=A&step=listEm&fn600=3&ppk100=#{item.fk100}&nn117=1&height=300px&width=400px" styleClass="fancybox">
                                                    <img title="edit" alt="edit" src="../images/edit.png">
                                                </h:outputLink>

                                                <h:outputLink   rendered="#{loginSession.right.COM_EMP_DEL}" value="delete.jsp?id=#{item.pn100}&pn100C=#{CustomerBean.fk100}&flag=convertEmpNV&height=150px&width=300px" styleClass="fancybox">
                                                    <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                                </h:outputLink> 
                                            </rich:column>

                                        </rich:dataTable>
                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </a4j:form>
        </f:view>
    </body>
</html>
<style type="text/css">
    .sendSMS_person{
        color: #0055A6;;
        cursor: pointer;
    }
    .blue{
        background: #E0EFFC;
    }
    .white{
        background:#FFFFFF;
    }
    #ui-datepicker-div
    {
        z-index: 9999999;
    }
    .record_row_left a:hover{color:black}
    .odd{
        background: #F2F7FC;
    }
    #fancybox-wrap{

    }
    .fields_input{
        float: left;
        margin-top: 8px;
        width: 100%;
    }
    .button-link{
        border:0;
        background:url(../images/bg_submit.gif) repeat-x;
        width:134px;
        float:right;
        margin:19px 0 10px 0;
        color:#ffffff;
        font-size:14px;
        font-weight:bold;
        cursor:pointer;
        border-radius:5px;
        box-shadow:0 2px 3px #666666;
        padding:8px 0;
        text-transform:uppercase;
    }
    .customer-box{
        float:left; width:604px; margin-left:25px;
        border:1px solid #CCCCCC;
        padding:18px 0px 10px 0px;
        background: #E5E8EA;
        border-top: none;

    }
    .customer-box label{
        width:90px;
        text-align: right;
        float:left;
    }
    input{
        float:left;
        margin-left:9px;
    }
    select{
        float:left;
        height: 21px;
        width:166px;
        margin-left:9px;
    }
    .ui-datepicker-header select{
        width:45% !important;
    }
    .header-box{
        margin-left:25px;
        color:#263340;
        margin-top:10px;
        float: left;
        cursor:pointer;
        padding:4px 0px 0px 4px; 
        width:600px;
        border:1px solid #CCCCCC;
        font-size:12px;
        background: #D4D7D8;
        height: 21px;
        font-weight: bold;
    }
    .fixdate .ui-datepicker-trigger  { margin-left: 4px;}

    .boder-bomttom{

    }
    .buttonsearch{
        border:0;
        background:url(../images/btn_search.png) repeat-x;
        width:30px !important; height:30px;
        color:#ffffff;
        cursor:pointer;
        text-transform:uppercase;
    }
    .mail_sms{
        float: right;
        margin-right: -19px;
        margin-top: 5px;
    }
    /*                .buttonsave {
                        background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
                        border: 0 none;
                        color: white;
                        cursor: pointer;
                        float: left;
                        font-size: 10px;
                        font-weight: bold;
                        height: 13px;
                        margin-bottom: 5px;
                        margin-right: 20px;
                        margin-top: 3px;
                        padding: 3px 7px;
                        text-transform: uppercase;
                        width: auto;
                    }*/
    .mesage{
        color: red;
        float: left;
        margin-left: 252px;
        margin-top: 20px;
        text-transform: uppercase;

    }

    .mesage123{
        color: red;
        float: left;
        margin-left: 252px;
        margin-top: 20px;
        text-transform: uppercase;

    }
    .feild_sex td label{width: 150px !important; color:white; font-size:12px; text-transform: none; margin-left:3px;}
    .buttonsearch:hover .group{display: block !important;}

    #fancybox-wrap{

    }
    .button-link{
        border:0;
        background:url(../images/bg_submit.gif) repeat-x;
        width:134px;
        float:right;
        margin:19px 0 10px 0;
        color:#ffffff;
        font-size:14px;
        font-weight:bold;
        cursor:pointer;
        border-radius:5px;
        box-shadow:0 2px 3px #666666;
        padding:8px 0;
        text-transform:uppercase;
    }
    div.rateit div.rateit-reset {

        width:0px !important;
    }

    .buttonsearch{
        border:0;
        background:url(../images/btn_search.png) repeat-x;
        width:30px; height:30px;
        color:#ffffff;
        cursor:pointer;
        text-transform:uppercase;
    }

    .feild_sex td label{width: 150px !important; color:white; font-size:12px; text-transform: none; margin-left:3px;}
    .buttonsearch:hover .group{display: block !important;}
    .buttonsearch2{
        border:0;
        background:url(../images/bg_submit.gif) repeat-x;
        width:68px;

        margin:0px 0 10px 20px;
        color:#ffffff;
        font-size:12px;
        font-weight:bold;
        cursor:pointer;
        border-radius:2px;
        padding:4px 0;
        text-transform:uppercase;
    }

    .ui-datepicker-header select{
        width:45% !important;
    }
    .greyRow{
        background: #E0EFFC;
    }
    .buttonsearch12 {
        background: url("../images/btn_search.png") no-repeat scroll 7px 4px white;
        border: 0 none;
        color: #FFFFFF;
        cursor: pointer;
        float: left;
        height: 20px;
        margin-left: 682px;
        margin-top: 1px;
        position: absolute;
        text-transform: uppercase;
        width: 28px;}
    .addTour1{
        background: url("../images/icon_addTour.png") repeat scroll 0 0 transparent;
        border-radius: 3px 3px 3px 3px;
        float: left;
        height: 22px;
        margin-left: 10px;
        margin-right: -140px;
        margin-top: 0;
        position: relative;
        width: 27px;
    }
    .abc img{
        width: 20px !important;
        height:  20px !important
    }
    .fast_search1{

        float: left;
        height: 32px;
        margin-bottom: 10px;
        margin-left: 201px;

        width: 266px;
    }
    .buttonsearch1{
        background: url("../images/btn_search.png") repeat-x scroll 0 0 transparent;
        border: 0 none;
        color: #FFFFFF;
        cursor: pointer;
        height: 18px;
        text-transform: uppercase;
        width: 17px !important;
    }
    #togglesms {
        background: none repeat scroll 0 0 #226579;
        float: left;
        right: 0px;

        position: absolute;
        z-index: 999;
        border-radius: 3px;
        border: 1px solid #53B4BF;
    }
    .classimageSMS{
        float:right;
        margin-top: -4px !important;
    }
    .classimageSMS img{
        width: 22px !important;
        height: 20px !important;
    }
</style>